<!--
 * @Author: namelll 2677065112@qq.com
 * @Date: 2023-05-31 16:07:57
 * @LastEditors: namelll 2677065112@qq.com
 * @LastEditTime: 2023-05-31 16:40:36
 * @FilePath: \vue3-ts-project\src\components\svgicon\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <!-- svg:图标外层容器，内部需要与use标签结合使用 -->
    <svg :style="{ width, height }">
        <use :xlink:href="prefix + name" :fill="color"></use>
    </svg>
</template>

<script setup lang="ts">
//接受父组件传递的参数
defineProps({
    // xlink:href属性前缀
    prefix: {
        type: String,
        default: '#icon-'
    },
    // 图标名字
    name: String,
    //图标颜色
    color: {
        type: String,
        default: ''
    },
    width: {
        type: String,
        default: '16px'
    },
    height: {
        type: String,
        default: '16px'
    }
})
</script>

<style scoped></style>
